home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / mac / raytrace / dkb / mcprt102.bnh / DKBTrace-Mac / mac_mpwconf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-10  |  4.6 KB  |  117 lines

  1. /*****************************************************************************
  2. *
  3. *                                   mac_mpwconf.h
  4. *
  5. *   from DKBTrace (c) 1990  David Buck
  6. *
  7. *  This file contains Macintosh-specific defines, types, etc for MPW C.
  8. *
  9. * This software is freely distributable. The source and/or object code may be
  10. * copied or uploaded to communications services so long as this notice remains
  11. * at the top of each file.  If any changes are made to the program, you must
  12. * clearly indicate in the documentation and in the programs startup message
  13. * who it was who made the changes. The documentation should also describe what
  14. * those changes were. This software may not be included in whole or in
  15. * part into any commercial package without the express written consent of the
  16. * author.  It may, however, be included in other public domain or freely
  17. * distributed software so long as the proper credit for the software is given.
  18. *
  19. * This software is provided as is without any guarantees or warranty. Although
  20. * the author has attempted to find and correct any bugs in the software, he
  21. * is not responsible for any damage caused by the use of the software.  The
  22. * author is under no obligation to provide service, corrections, or upgrades
  23. * to this package.
  24. *
  25. * Despite all the legal stuff above, if you do find bugs, I would like to hear
  26. * about them.  Also, if you have any comments or questions, you may contact me
  27. * at the following address:
  28. *
  29. *     David Buck
  30. *     22C Sonnet Cres.
  31. *     Nepean Ontario
  32. *     Canada, K2H 8W7
  33. *
  34. *  I can also be reached on the following bulleton boards:
  35. *
  36. *     ATX              (613) 526-4141
  37. *     OMX              (613) 731-3419
  38. *     Mystic           (613) 731-0088 or (613) 731-6698
  39. *
  40. *  Fidonet:   1:163/109.9
  41. *  Internet:  David_Buck@Carleton.CA
  42. *
  43. *  MPW Port by Thomas Okken. He can be reached at:
  44. *
  45. *     Thomas Okken
  46. *     Hoornseweg 6
  47. *     2635 CM  Den Hoorn
  48. *     Netherlands
  49. *     (015) 565044        (Between 19.00 and 24.00 GMT)
  50. *
  51. *****************************************************************************/
  52.  
  53.  
  54. /* The following defines may be added when porting to other systems or
  55.    other compilers.  The defaults are shown here:
  56.  
  57.  
  58.    #define PARAMS(x) x                   - use 'x' for ANSI, '()' for non ANSI
  59.    #define EPSILON 1.0e-5                - a small value used for quartics
  60.    #define FILE_NAME_LENGTH 150          - default file name length
  61.    #define DBL double                    - floating point precision
  62.    #define HUGE_VAL 1.0e+17              - a really big number
  63.    #define DBL_FORMAT_STRING "%lf"       - the string to use for scanfs of doubles
  64.    #define DEFAULT_OUTPUT_FORMAT  'd'    - the default +f format
  65.    #define TEST_ABORT                    - code to test for ^C or abort
  66.                                            (called on each pixel)
  67.    #define RED_RAW_FILE_EXTENSION ".red" - for +fr, this is the extension for the
  68.                                            red file
  69.    #define GREEN_RAW_FILE_EXTENSION ".grn"  - ditto for the green file
  70.    #define BLUE_RAW_FILE_EXTENSION ".blu"   - ditto again for the blue file
  71.    #define STARTUP_DKB_TRACE             - first executable statement of main
  72.                                            (useful for initialization)
  73.    #define PRINT_OTHER_CREDITS           - used for people who extend dkbtrace.
  74.                                            (put your own printf's here)
  75.    #define FINISH_DKB_TRACE              - last statement before exiting normally
  76.    #define FILENAME_SEPARATOR "/"        - the character that separates names
  77.                                            in a path.
  78.    #define setvbuf(w,x,y,z)              - some systems don't understand setvbuf.
  79.                                            If not, just define it away - it's
  80.                                            not critical to the raytracer.  It
  81.                                            just buffers disk accesses.
  82. */
  83.  
  84. #include <stdarg.h>
  85. #include <stdlib.h>
  86.  
  87. #define Macintosh
  88.  
  89. #define DBL extended
  90. #define DBL_FORMAT_STRING "%Lf"
  91.  
  92. #define ACOS acos
  93. #define SQRT sqrt
  94. #define POW pow
  95. #define COS cos
  96. #define SIN sin
  97. #define EPSILON 1.0e-5
  98.  
  99. /* This gives us ANSI prototyping */
  100. #define PARAMS(x) x
  101. #define volatile
  102.  
  103. #define TEST_ABORT MacDawdle();
  104. #define PRINT_OTHER_CREDITS MacBrag();
  105. #define FILENAME_SEPARATOR ":"
  106.  
  107. #define max(x,y) ((x<y)?y:x)
  108.  
  109. /* This is to set Mac filetypes & creators on DKBTrace's output files */
  110. void SetTypeAndCreator(char *name, long type, long creator);
  111. #define Dump_Type 'Dump'
  112. #define Dump_Creator 'disD'
  113. #define Raw_Type 'Raw '
  114. #define Raw_Creator 'dkbT'
  115. #define Targa_Type 'TPIC'
  116. #define Targa_Creator '8BIM'
  117.